Trajectory pinning (via session_id) for consistent model selection in routing#827
Open
adilhafeez wants to merge 5 commits intomainfrom
Open
Trajectory pinning (via session_id) for consistent model selection in routing#827adilhafeez wants to merge 5 commits intomainfrom
adilhafeez wants to merge 5 commits intomainfrom
Conversation
Contributor
|
The test case that would prove this is an agentic loop. Can you build some test cases for that and test with live clients like anthropic and/or openai? @nehcgs please review. The idea is that if the model is not done, we should pin the agentic loop to a single model until we get the [done] flag from the model, at which point we can resume our model routing logic. |
- extend brightstaff llm_chat_inner to extract X-Session-Id, check the session cache before routing, and cache the result afterward — same pattern as routing_service.rs - replace old urllib-based demo with a real FastAPI research agent that runs 3 independent tool-calling tasks with alternating intents so Plano routes to different models; demo.py is a pure httpx client that shows the routing trace side-by-side with and without session pinning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #813
X-Session-Idheader support to the/routing/v1/*endpoints. When provided, the first routing decision is cached and subsequent requests with the same session ID return the pinned model without re-running routing.session_ttl_seconds(default 600s) andsession_max_entries(default 10,000) viaroutingconfig section.session_idandpinnedfields to indicate cache status. No breaking changes — requests without the header behave as before.